package com.iplant.basic.service.po.crm;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.join.DBJoin;
import com.iplant.base.utils.annotation.join.multi.DBJoinMulti;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.basic.service.basicenum.crm.CRMCustomerGrade;

import java.io.Serializable;

@DBBasePO(TableName = "crm_customer", CheckName = {"Code", "Name"}, Schemas = DBSchemas.Basic)
public class CRMCustomer extends BasePO implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 税号
     */
    @DBField
    public String TaxCode = "";

    /**
     * 行业
     */
    @DBField
    public String Industry = "";
    /**
     * 联系人
     */
    @DBField
    public String ContactName = "";
    /**
     * 电话
     */
    @DBField
    public String Telephone = "";

    /**
     * 联系人2
     */
    @DBField
    public String ContactNameDeputy = "";
    /**
     * 电话2
     */
    @DBField
    public String TelephoneDeputy = "";


    /**
     * 邮箱
     */
    @DBField
    public String Email = "";

    /**
     * 固定电话
     */
    @DBField
    public String LinePhone = "";


    /**
     * 国家/地区
     */
    @DBField
    public String Country = "";

    /**
     * 省/市
     */
    @DBField
    public String Province = "";
    /**
     * 市/区
     */
    @DBField
    public String City = "";
    /**
     * 地址
     */
    @DBField
    public String Address = "";

    /**
     * 邮编
     */
    @DBField
    public String PostalCode = "";

    /**
     * 等级
     */
    @DBField
    public int Grade = 0;
    /**
     * 等级描述
     */
    public String GradText = "";
    /**
     * 客户类型
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.findInSet)
    @DBField
    public String TypeID = "";

    @DBJoinMulti(Name = "Name", MainTableField = "TypeID", TableName = "crm_customertype", Schemas = DBSchemas.Basic,
            OutTableField = "ID")
    public String TypeName = "";
    @DBJoinMulti(Name = "Code", MainTableField = "TypeID", TableName = "crm_customertype", Schemas = DBSchemas.Basic,
            OutTableField = "ID")
    public String TypeCode = "";
    @DBField
    public int CarrierID = 0;
    /**
     * 承运方
     */
    @DBJoin(name = "Name", tableName = "crm_customer", tableAsName = "customer1", Schemas = DBSchemas.Basic,
            MainTableField = "CarrierID")
    public String CarrierName = "";
    @DBJoin(name = "Code", tableName = "crm_customer", tableAsName = "customer1", Schemas = DBSchemas.Basic,
            MainTableField = "CarrierID")
    public String CarrierCode = "";
    @DBField
    public int SettlerID = 0;
    /**
     * 结算方
     */
    @DBJoin(name = "Name", tableName = "crm_customer", tableAsName = "customer2", Schemas = DBSchemas.Basic,
            MainTableField = "SettlerID")
    public String SettlerName = "";
    @DBJoin(name = "Code", tableName = "crm_customer", tableAsName = "customer2", Schemas = DBSchemas.Basic,
            MainTableField = "SettlerID")
    public String SettlerCode = "";

    @DBField
    public String LogoIcon = "";

    @JsonProperty("TaxCode")
    public String getTaxCode() {
        return TaxCode;
    }

    public void setTaxCode(String taxCode) {
        TaxCode = taxCode;
    }

    @JsonProperty("Industry")
    public String getIndustry() {
        return Industry;
    }

    public void setIndustry(String industry) {
        Industry = industry;
    }

    @JsonProperty("ContactName")
    public String getContactName() {
        return ContactName;
    }

    public void setContactName(String contactName) {
        ContactName = contactName;
    }

    @JsonProperty("Telephone")
    public String getTelephone() {
        return Telephone;
    }

    public void setTelephone(String telephone) {
        Telephone = telephone;
    }

    @JsonProperty("ContactNameDeputy")
    public String getContactNameDeputy() {
        return ContactNameDeputy;
    }

    public void setContactNameDeputy(String contactNameDeputy) {
        ContactNameDeputy = contactNameDeputy;
    }

    @JsonProperty("TelephoneDeputy")
    public String getTelephoneDeputy() {
        return TelephoneDeputy;
    }

    public void setTelephoneDeputy(String telephoneDeputy) {
        TelephoneDeputy = telephoneDeputy;
    }

    @JsonProperty("Email")
    public String getEmail() {
        return Email;
    }

    public void setEmail(String email) {
        Email = email;
    }

    @JsonProperty("LinePhone")
    public String getLinePhone() {
        return LinePhone;
    }

    public void setLinePhone(String linePhone) {
        LinePhone = linePhone;
    }

    @JsonProperty("Country")
    public String getCountry() {
        return Country;
    }

    public void setCountry(String country) {
        Country = country;
    }

    @JsonProperty("Province")
    public String getProvince() {
        return Province;
    }

    public void setProvince(String province) {
        Province = province;
    }

    @JsonProperty("City")
    public String getCity() {
        return City;
    }

    public void setCity(String city) {
        City = city;
    }

    @JsonProperty("Address")
    public String getAddress() {
        return Address;
    }

    public void setAddress(String address) {
        Address = address;
    }

    @JsonProperty("PostalCode")
    public String getPostalCode() {
        return PostalCode;
    }

    public void setPostalCode(String postalCode) {
        PostalCode = postalCode;
    }

    @JsonProperty("Grade")
    public int getGrade() {
        return Grade;
    }

    public void setGrade(int grade) {
        Grade = grade;
    }

    @JsonProperty("GradText")
    public String getGradText() {
        GradText = CRMCustomerGrade.getEnumType(Grade).getLabel();
        return GradText;
    }

    public void setGradText(String gradText) {
        GradText = gradText;
    }

    @JsonProperty("TypeCode")
    public String getTypeCode() {
        return TypeCode;
    }

    public void setTypeCode(String typeCode) {
        TypeCode = typeCode;
    }

    @JsonProperty("TypeID")
    public String getTypeID() {
        return TypeID;
    }

    public void setTypeID(String typeID) {
        TypeID = typeID;
    }

    @JsonProperty("TypeName")
    public String getTypeName() {
        return TypeName;
    }

    public void setTypeName(String typeName) {
        TypeName = typeName;
    }

    @JsonProperty("CarrierID")
    public int getCarrierID() {
        return CarrierID;
    }

    public void setCarrierID(int carrierID) {
        CarrierID = carrierID;
    }

    @JsonProperty("CarrierName")
    public String getCarrierName() {
        return CarrierName;
    }

    public void setCarrierName(String carrierName) {
        CarrierName = carrierName;
    }

    @JsonProperty("CarrierCode")
    public String getCarrierCode() {
        return CarrierCode;
    }

    public void setCarrierCode(String carrierCode) {
        CarrierCode = carrierCode;
    }

    @JsonProperty("SettlerID")
    public int getSettlerID() {
        return SettlerID;
    }

    public void setSettlerID(int settlerID) {
        SettlerID = settlerID;
    }

    @JsonProperty("SettlerName")
    public String getSettlerName() {
        return SettlerName;
    }

    public void setSettlerName(String settlerName) {
        SettlerName = settlerName;
    }

    @JsonProperty("SettlerCode")
    public String getSettlerCode() {
        return SettlerCode;
    }

    public void setSettlerCode(String settlerCode) {
        SettlerCode = settlerCode;
    }

    @JsonProperty("LogoIcon")
    public String getLogoIcon() {
        return LogoIcon;
    }

    public void setLogoIcon(String logoIcon) {
        LogoIcon = logoIcon;
    }
}
